<?php
require_once("init.php");
require_once("inc/header.php");

$page=$_GET['page'];
if(!intval($page)>0) {
    $page=1;
}
$url="http://twitter.com/direct_messages/sent.json?page=".$page;
$dms=obj_to_array(get_from_twitter($url));
$i=0;
foreach($dms as $msg) {
    $i+=1;
    show_dm_msg($i,$msg,"sent");
}
if($page>1) {
    echo "<a href='sent.php?type=".$type."&page=".($page-1)."'>prev</a> ";
}
echo "<a href='sent.php?type=".$type."&page=".($page+1)."'>next</a> ";
require_once("inc/footer.php");
?>